<!DOCTYPE html>
<html>
<head>
    <title>标签</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="木兰湾管理系统">
    <script type="text/javascript" src="../../static/include/header-css.js"></script>
    <!--tag 编辑-->
    <link rel="stylesheet" href="../../static/css/jquery.tag-editor.css">
</head>
<body>
<div id="tag-commonEdit-form">
    <div class="page-hd">
        <div class="weui-cells__title"><span class='mulanbay_textarea_title'>食物</span><span class="mulanbay-notNull">*</span></div>
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <input class="weui-input" type="tag" placeholder="每输入一个按回车" name="foods" id="foods">
                </div>
            </div>
        </div>
    </div>
    <div class="page-bd-15">
        <div class="weui-label-list">
            <label class="label f-blue b-blue" onclick="addTag('李白')">李白</label>
            <label class="label f-white bg-green" onclick="addTag('韩信')">韩信</label>
            <label class="label f-red b-red" onclick="addTag('蔡文姬')">蔡文姬</label>
            <label class="label f-green b-green">毒奶</label>
        </div>
        <div class="weui-label-list">
            <label class="weui-label-s b-green">金庸</label> <label class="weui-label-s b-orange">梁羽生</label>
            <label class="weui-label-s b-blue f-blue">古龙</label> <label class="weui-label-s b-red f-green">卧龙生</label>
        </div>
    </div>
</div>
<br>

<script type="text/javascript" src="../../static/include/footer-js.js"></script>
<!--tag 编辑-->
<script type="text/javascript" src="../../static/js/jquery.tag-editor.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.caret.min.js"></script>

<script>
    $(function() {
        initTagEdit(['foods']);
    });
    function addTag(tag) {
        $('#foods').tagEditor('addTag', tag);
    }
    function removeTag(tag) {
        $('#foods').tagEditor('removeTag', tag);
    }
</script>
</body>
</html>